<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	lang="en">
	
	<h:head>
		<title>Cadastro de Usuário</title>
	</h:head>
	
	<h:body>
		<br />
		
		<h:form>
			<h:messages></h:messages>
			<p:panel header="Informações do Usuário">
				<h:outputLabel for="nome" value="Nome:"/>
				<br />
				<h:inputText id="nome" value="#{UsuarioMB.entidade.nome}" maxlength="20"/>
				<br />
				<h:outputLabel for="email" value="E-mail:"/>
				<br />
				<h:inputText id="email" required="true" value="#{UsuarioMB.entidade.email}" 
					validatorMessage="Obrigatório informar um E-mail válido">
					<f:validateRegex pattern="\w+@\w+(\.\w+)+"></f:validateRegex>
				</h:inputText>
				<br />
				<h:outputLabel for="senha" value="Senha:"/>
				<br />
				<h:inputSecret id="senha" value="#{UsuarioMB.entidade.senha}" maxlength="20"/>
				<br />
				<h:commandButton action="#{UsuarioMB.gravar}" value="Gravar"/>
			</p:panel>
		</h:form>
	</h:body>
	
</html>